Skip to content

Add null-safe field access for functions#137

Closed
KoloInDaCrib wants to merge 1 commit intoHaxeFoundation:masterfrom
KoloInDaCrib:question-dot-function-upstream
Closed

Add null-safe field access for functions#137
KoloInDaCrib wants to merge 1 commit intoHaxeFoundation:masterfrom
KoloInDaCrib:question-dot-function-upstream

Conversation

@KoloInDaCrib
Copy link
Contributor

[field]?.[function]() causes errors if field is null, which this PR aims to fix.

@kLabz
Copy link
Contributor

kLabz commented Feb 16, 2025

Well, that's the general Haxe behavior for this syntax. There's no syntax for this yet, why would hscript have one?

@KoloInDaCrib
Copy link
Contributor Author

KoloInDaCrib commented Feb 16, 2025

Well, that's the general Haxe behavior for this syntax. There's no syntax for this yet, why would hscript have one?

Because hscript already has null-safe field access with ?. and this PR is just an addition to that feature. It doesn't subtract any previous feature, just builds on top of an already existing one.

@Simn
Copy link
Member

Simn commented Feb 16, 2025

Hscript should definitely not have syntax that Haxe proper doesn't have.

@Simn Simn closed this Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants